﻿var ns = namespace("kaskelot.web");

ns.person = function () {
    function showEditForm() {
        var btns = {
            OK: function () {
                if (validate("#form-container")) {
                    $("input:submit").click();
                }
            },
            Avbryt: function () {
                $(this).dialog("close");
                window.location.reload(true);
            }
        }

        var dlg = $("#form-container").dialog({
            height: 250,
            width: 550,
            draggable: true,
            resizable: true,
            modal: true,
            buttons: btns
        });

        $("div.ui-widget-overlay").appendTo(jQuery("form:first"));
        dlg.parent().appendTo(jQuery("form:first"));
    }

    function redirect() {
        window.location.href = window.location.href;
    }

    return {
    	showEditForm: showEditForm,
		redirect: redirect
    }
}();